<?php
/**
 * Joomla! 1.5 component Bbits Simple directory
 *
 * @version $Id: view.html.php 2011-07-08 03:53:16 svn $
 * @author Miguel Puig
 * @URL http://miguelpuig.com
 * @package Joomla
 * @subpackage Bbits Simple directory
 * @license GNU/GPL
 *
 * Simple Directory by bittingbits.com
 *
 *
 */
// no direct access
defined('_JEXEC') or die('Restricted access');

/*
 * Define constants for all pages
 */
define( 'COM_BBITSD_DIR', 'images'.DS.'bbitsd'.DS );
define( 'COM_BBITSD_BASE', JPATH_ROOT.DS.COM_BBITSSD_DIR );
define( 'COM_BBITSD_BASEURL', JURI::root().str_replace( DS, '/', COM_BBITSD_DIR ));

// Set helper directory
JHTML::addIncludePath(JPATH_ROOT.DS.'components'.DS.'com_bbitsd'.DS.'helpers'.DS);
JHTML::addIncludePath(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_bbitsd'.DS.'helpers'.DS);
JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'tables');

// Require the base controller
require_once JPATH_COMPONENT.DS.'controller.php';

// Require the base controller
require_once JPATH_COMPONENT.DS.'helpers'.DS.'helper.php';

// Initialize the dedicated controller
if ($controller = JRequest::getWord('controller')) {
    // determine path
    $path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
    if (file_exists($path)) {
        require_once $path;
    } else $controller = '';
}

$classname = 'BbitsdController'.$controller;
$controller = new $classname();

// Perform the Request task
$controller->execute( JRequest::getVar('task'));
$controller->redirect();
?>
